package com.wj.tool.common.utils;

import org.apache.commons.collections4.MapUtils;
import org.springframework.lang.Nullable;

import java.util.Collection;
import java.util.List;
import java.util.Map;

public final class CollectionUtils {
    public static boolean isEmpty(Collection<?> collection) {
        return org.apache.commons.collections4.CollectionUtils.isEmpty(collection);
    }

    public static boolean isNotEmpty(Collection<?> collection) {
        return org.apache.commons.collections4.CollectionUtils.isNotEmpty(collection);
    }

    public static boolean isEmpty(Map<?, ?> map) {
        return MapUtils.isEmpty(map);
    }

    public static List arrayToList(@Nullable Object source) {
        return org.springframework.util.CollectionUtils.arrayToList(source);
    }

    private CollectionUtils() {
    }
}